package com.zichen.pr.system.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zichen.pr.common.core.domain.entity.SysDictData;
import com.zichen.pr.common.core.domain.entity.SysDictType;
import com.zichen.pr.system.mapper.SysDictDataMapper;
import com.zichen.pr.system.mapper.SysDictTypeMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: pr
 * @description: 字段服务层
 * @author: rzhang
 * @create: 2021-04-01 16:53
 */
@Service("sysDictTypeService")
public class SysDictTypeService extends ServiceImpl<SysDictTypeMapper, SysDictType> {

    @Resource
    private SysDictTypeMapper sysDictTypeMapper;

    @Resource
    private SysDictDataMapper sysDictDataMapper;

    /**
     * 根据条件分页查询字典类型
     *
     * @param dictType 字典类型信息
     * @return 字典类型集合信息
     */
    public List<SysDictType> selectDictTypeList(SysDictType dictType) {
        return sysDictTypeMapper.selectDictTypeList(dictType);
    }

    /**
     * 根据字典类型查询字典数据
     *
     * @param dictType 字典类型
     * @return 字典数据集合信息
     */
    public List<SysDictData> selectDictDataByType(String dictType) {
        return sysDictDataMapper.selectDictDataByType(dictType);
    }

    /**
     * 根据所有字典类型
     *
     * @return 字典类型集合信息
     */
    public List<SysDictType> selectDictTypeAll() {
        return sysDictTypeMapper.selectDictTypeAll();
    }
}
